package service.impl;

import bean.UserAddress;
import com.alibaba.dubbo.common.utils.StringUtils;
import service.UserService;

import java.util.List;

public class UserServiceStub implements UserService{
    private final UserService userService;

    //dubbo底层将远程实现注入到构造器中
    public UserServiceStub(UserService userService) {
        this.userService = userService;
    }

    @Override
    public List<UserAddress> getUserAddressList(String userId) {
        System.out.println("本地存根被调用");

        if (StringUtils.isNotEmpty(userId)) {
            return userService.getUserAddressList(userId);
        }
        return null;
    }
}
